#include "Boss2ItemEntity.h"

Boss2ItemEntity::Boss2ItemEntity(int type, double x, double y)
{
	_data = new Boss2ItemData(0, type, x, y);
	_itemsPhysics = new BossItemPhysics();
}

void  Boss2ItemEntity:: update(long time){

	_data->sprites->updateCurrent();
}

void  Boss2ItemEntity:: draw(long time){
	_data->sprites->draw();
}

AbstractData* Boss2ItemEntity::getAbstractData()
{
	return _data;
}

void  Boss2ItemEntity:: setMovingState(MovingState movingState)
{
	_move(movingState);
	_data->getRect()->X += _data->getRect()->Vx;
	_data->getRect()->Y += _data->getRect()->Vy;

}
void  Boss2ItemEntity:: _move(MovingState movingState)
{
	switch (movingState)
	{
	case STATE_MOVING_UP:
	case STATE_MOVING_LEFT:
	case STATE_MOVING_TOP:
	case STATE_MOVING_DOWN:
		_itemsPhysics->movingUP(_data->getRect());
		break;
	case STATE_NONE:
		_data->getRect()->Vx = _data->getRect()->Vy= 0;
		break;
	default:
		_data->getRect()->Vx = _data->getRect()->Vy= 0;
		break;
	}
}